//
//  LoginModel.swift
//  股票框架
//
//  Created by 李小骥 on 2017/9/29.
//  Copyright © 2017年 李小骥. All rights reserved.
//

import UIKit

class LoginModel: NSObject {
 
}
struct RequestVerificationCode {
    //code 将来是枚举
    var code:Int
//    data临时是 String
    var data:String
    var message:String
    //登录状态将来改成枚举
    var status:Int
    init(code:Int,data:String,message:String,status:Int){
        //后续增加内容是否为空“”的判断
        self.code = code
        self.data = data
        self.message = message
        self.status = status
    }
}
class userInfomation:NSObject,NSCoding{
    func encode(with aCoder: NSCoder) {
        aCoder.encode(phoneNumber, forKey: "phoneNumber")
        aCoder.encode(status, forKey: "status")
        aCoder.encode(code, forKey: "code")
        aCoder.encode(qq, forKey: "qq")
        aCoder.encode(user_rank, forKey: "user_rank")
        aCoder.encode(userID, forKey: "userID")
        aCoder.encode(imageUrl, forKey: "imageUrl")
        aCoder.encode(token, forKey: "token")
        aCoder.encode(experience, forKey: "experience")
        aCoder.encode(birthday, forKey: "birthday")
        aCoder.encode(area, forKey: "area")
        aCoder.encode(user_name, forKey: "user_name")
        aCoder.encode(sex, forKey: "sex")
        aCoder.encode(message, forKey: "message")
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        self.phoneNumber = aDecoder.decodeObject(forKey: "phoneNumber") as! String
        self.status = aDecoder.decodeObject(forKey: "status") as! String
        self.code = aDecoder.decodeObject(forKey: "code") as! String
        self.message = aDecoder.decodeObject(forKey: "message") as! String
        self.qq = aDecoder.decodeObject(forKey: "qq") as! String
        self.user_rank = aDecoder.decodeObject(forKey: "user_rank") as! String
        self.userID = aDecoder.decodeObject(forKey: "userID") as! String
        self.imageUrl = aDecoder.decodeObject(forKey: "imageUrl") as! String
        self.token = aDecoder.decodeObject(forKey: "token") as! String
        self.experience = aDecoder.decodeObject(forKey: "experience") as! String
        self.birthday = aDecoder.decodeObject(forKey: "birthday") as! String
        self.area = aDecoder.decodeObject(forKey: "area") as! String
        self.user_name = aDecoder.decodeObject(forKey: "user_name") as! String
        self.sex = aDecoder.decodeObject(forKey: "sex") as! String
    }
    
    var phoneNumber:String
    var status:String
    var code:String
    var message:String
    var qq:String
    var user_rank:String
    var userID:String
    var imageUrl:String
    //    暂定 token 是 String
    var token:String
    var experience:String
    var birthday:String
    var area:String
    var user_name:String
    //登录状态将来改成枚举
    var sex:String
       init(requestLoginCode:RequestLoginCode) {
        self.phoneNumber = requestLoginCode.phoneNumber
        self.status = requestLoginCode.status
        self.code = requestLoginCode.code
        self.message = requestLoginCode.message
        self.qq = requestLoginCode.qq
        self.user_rank = requestLoginCode.user_rank
        self.userID = requestLoginCode.userID
        self.imageUrl = requestLoginCode.imageUrl
        self.token = requestLoginCode.token
        self.experience = requestLoginCode.experience
        self.birthday = requestLoginCode.birthday
        self.area = requestLoginCode.area
        self.user_name = requestLoginCode.user_name
        self.sex = requestLoginCode.sex
        super.init()
    }
    
}
struct RequestLoginCode {
    //code 将来是枚举
    var phoneNumber:String
    var status:String
    var code:String
    var message:String
    var qq:String
    var user_rank:String
    var userID:String
    var imageUrl:String
//    暂定 token 是 String
    var token:String
    var experience:String
    var birthday:String
    var area:String
    var user_name:String
    //登录状态将来改成枚举
    var sex:String
    init(status:String,code:String,message:String,qq:String,user_rank:String,userID:String,imageUrl:String,token:String,experience:String,birthday:String,area:String,user_name:String,sex:String,phoneNumber:String){
        //后续增加内容是否为空“”的判断
        self.status = status
        self.code = code
        self.message = message
        self.qq = qq
        self.user_rank = user_rank
        self.userID = userID
        self.imageUrl = imageUrl
        self.token = token
        self.experience = experience
        self.birthday = birthday
        self.area = area
        self.user_name = user_name
        self.sex = sex
        self.phoneNumber = phoneNumber
    }
}
